/***********************************************************************
    filename:   Dater.h
    created:    25/3/2012
    author:     4Ys

    purpose:    Defines class TestConsole and DaterApp in UI
*************************************************************************/
#ifndef _Dater_h_
#define _Dater_h_

#include "CEGuiSample.h"
#include "CEGUI.h"
#include "DaterBaseWindow.h"
#include <Windows.h>
#include <map>
#include <string>

class TestConsole
{
	/*!
	\brief
		To test communication on a server(not used in Dater).
	*/
public:
	TestConsole(const CEGUI::String& id_name, CEGUI::Window* parent = 0);
	~TestConsole();

private:
	static const unsigned int SubmitButtonID;
    static const unsigned int InputID;
    static const unsigned int OutputID;

	bool handleSubmit(const CEGUI::EventArgs& args);

	CEGUI::Window* _root;

};

// Sample class
class DaterApp : public CEGuiSample
{
	/*!
	\brief
		The core class of process in UI.
	*/
public:
	
		/* !
		\brief
			Override member to initialse the sample.
		*/
    bool initialiseSample();
	
		/* !
		\brief
			Override member to perform cleanup.
		*/
    void cleanupSample(void);

		/* !
		\brief
			Handle the Message received.
			
		\param string
			- Message received.
		*/
	void handleRecvMessage(std::string);

		/* !
		\brief
			Exit the process.
		*/
	void exitApp();

private:
		/* !
		\brief
			Member to subscribe handler to each 'slot' in the layout.
		*/
    void subscribeEvents();
	
		/* !
		\brief
			Member that handles the frame window close button and quits.
			
		\param args
			- the processing program.
		*/
    bool handle_CloseButton(const CEGUI::EventArgs& args);

		/* !
		\brief
			Member that handles the frame window to add event.
			
		\param args
			- the processing program.
		*/
	bool handle_AddEvent(const CEGUI::EventArgs& args);

		/* !
		\brief
			Member that handles the frame window to register.
			
		\param args
			- the processing program.
		*/
	bool handle_Register(const CEGUI::EventArgs& args);

		/* !
		\brief
			Member that handles the frame window to login.
			
		\param args
			- the processing program.
		*/
	bool handle_Login(const CEGUI::EventArgs& args);

		/* !
		\brief
			Member that handles the frame window to exit.
			
		\param args
			- the processing program.
		*/
	bool handle_Exit(const CEGUI::EventArgs& args);

	bool handle_SubmitServerAddress(const CEGUI::EventArgs& args);

	//TestConsole* d_console;
	
	std::map<std::string, BaseWindow*> _daterWindows;
};


#endif  // end of guard _Sample_DragDropDemo_h_

